From 0a7a3f2fa2ab281a3e117ce17a56bb9723159520 Mon Sep 17 00:00:00 2001 From: "13:38:36 Tim Janik" Date: Thu, 6 Dec 2007 12:38:00 +0000 Subject: [PATCH] ported to new testing framework. 2007-12-06 13:38:36 Tim Janik * tests/floatingtest.c: ported to new testing framework. * tests/Makefile.am: run floatingtest as testing framework test. svn path=/trunk/; revision=19118 --- ChangeLog | 6 ++++++ tests/Makefile.am | 9 ++++----- tests/floatingtest.c | 27 +++++++++++++++++---------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index e295aecd16..2748eda802 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-06 13:38:36 Tim Janik + + * tests/floatingtest.c: ported to new testing framework. + + * tests/Makefile.am: run floatingtest as testing framework test. + 2007-12-06 10:44:52 Tim Janik * tests/autotestfilechooser.c: majorly speed up execution by reducing diff --git a/tests/Makefile.am b/tests/Makefile.am index ccee78151b..4435750b50 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,7 +25,9 @@ if USE_X11 testsocket_programs = testsocket testsocket_child endif - +TEST_PROGS += floatingtest +floatingtest_DEPENDENCIES = $(TEST_DEPS) +floatingtest_LDADD = $(LDADDS) TEST_PROGS += objecttests objecttests_SOURCES = objecttests.c objecttests_LDADD = $(LDADDS) @@ -36,11 +38,10 @@ autotestfilechooser_LDADD = $(LDADDS) autotestfilechooser_SOURCES = autotestfilechooser.c -TESTS = floatingtest buildertest +TESTS = buildertest noinst_PROGRAMS = $(TEST_PROGS) \ autotestkeywords \ - floatingtest \ buildertest \ simple \ print-editor \ @@ -117,7 +118,6 @@ endif endif simple_DEPENDENCIES = $(TEST_DEPS) -floatingtest_DEPENDENCIES = $(TEST_DEPS) buildertest_DEPENDENCIES = $(TEST_DEPS) print_editor_DEPENDENCIES = $(TEST_DEPS) testicontheme_DEPENDENCIES = $(TEST_DEPS) @@ -173,7 +173,6 @@ testtooltips_DEPENDENCIES = $(TEST_DEPS) testvolumebutton_DEPENDENCIES = $(TEST_DEPS) simple_LDADD = $(LDADDS) -floatingtest_LDADD = $(LDADDS) buildertest_LDADD = $(LDADDS) print_editor_LDADD = $(LDADDS) testaccel_LDADD = $(LDADDS) diff --git a/tests/floatingtest.c b/tests/floatingtest.c index 458acd887b..d0682cf5d2 100644 --- a/tests/floatingtest.c +++ b/tests/floatingtest.c @@ -20,16 +20,16 @@ #include "../gtk/gtk.h" static gboolean destroyed = FALSE; -static void destroy (void) { destroyed = TRUE; } - -int -main (int argc, - char *argv[]) +static void +destroy (void) { - GtkWidget *widget; - gtk_init (&argc, &argv); + destroyed = TRUE; +} - widget = g_object_new (GTK_TYPE_LABEL, NULL); +static void +floating_tests (void) +{ + GtkWidget *widget = g_object_new (GTK_TYPE_LABEL, NULL); g_object_connect (widget, "signal::destroy", destroy, NULL, NULL); g_assert (GTK_OBJECT_FLOATING (widget)); @@ -59,6 +59,13 @@ main (int argc, g_assert (!destroyed); g_object_unref (widget); g_assert (destroyed); - - return 0; +} + +int +main (int argc, + char *argv[]) +{ + gtk_test_init (&argc, &argv); + g_test_add_func ("/floatingtest", floating_tests); + return g_test_run(); } -- 2.30.2